/*
 * @Author: your name
 * @Date: 2021-03-16 15:21:41
 * @LastEditTime: 2021-04-12 14:24:28
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \test\src\store\mutations.js
 */
// 更改用户状态信息
export const userStatus = (state, user) => {
  console.log('user vuex userStatus', user)
  if (user) {
    state.currentUser = user
    state.isLogin = true
  } else if (user == null) {
    // 登出的时候，清空sessionStorage里的东西
    sessionStorage.setItem('userName', null)
    state.currentUser = null
    state.isLogin = false
    state.token = ''
  }
}
